package com.example.knowman.ObService.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.knowman.ObService.OBknowArchFilesService;
import com.example.knowman.ReturnMessage.Message;
import com.example.knowman.entity.knowArchFiles;
import com.example.knowman.entity.knowMain;
import com.example.knowman.mapper.KnowArchFilesMapper;
import com.example.knowman.service.IknowArchFilesService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OBKnowArchFilesServiceImpl extends ServiceImpl<KnowArchFilesMapper, knowArchFiles> implements OBknowArchFilesService {


    @Override
    public void deleteByKnowId(Integer knowId) {
        QueryWrapper<knowArchFiles> wrapper = new QueryWrapper<>();
        wrapper.eq("\"knowId\"",knowId);
        try{
            this.remove(wrapper);
        }catch (Exception e){

        }
    }

    @Override
    public List<knowArchFiles> getByKnowId(Integer knowId) {
        return this.lambdaQuery().eq(knowArchFiles::getKnowId,knowId).list();
    }
}
